home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / pascal / twins.com / WINDOWS.INF < prev    next >
Encoding:
Text File  |  1990-02-15  |  3.5 KB  |  129 lines

  1.                      (***********************************)
  2.                      (*       TWINS Version 1.01        *)
  3.                      (***********************************)
  4.                      (*     Object -Oriented Windows    *)
  5.                      (*  for Turbo Pascal Version 5.5   *)
  6.                      (*         Copyright 1990          *)
  7.                      (*          Brian Corll            *)
  8.                      (*       All Rights Reserved       *)
  9.                      (***********************************)
  10.                      (***********************************)
  11.                      (*   Turbo Pascal is a registered  *)
  12.                      (* trademark of Borland Int. Corp. *)
  13.                      (***********************************)
  14.                      (*   Portions Copyright 1984,1989  *)
  15.                      (*    Borland International Corp.  *)
  16.                      (***********************************)
  17.                      (***********************************)
  18.  
  19. UNIT WINDOWS;
  20.  
  21. INTERFACE
  22.  
  23. Uses Screens;
  24.  
  25. CONST
  26.  MaxWins  = 255;
  27.  Shadow = TRUE;
  28.  NoShadow = FALSE;
  29.  
  30.  
  31.     { These window borders are defined in SCREENS.PAS:
  32.   SolidBrdr   : Borders = '██████';
  33.   SingleBrdr  : Borders = '┌└┐┘─│';
  34.   DoubleBrdr  : Borders = '╔╚╗╝═║';
  35.   Stars       : Borders = '******';
  36.   QuarterTone : Borders = '░░░░░░';
  37.   HalfTone    : Borders = '▒▒▒▒▒▒';}
  38.  
  39. TYPE
  40.   Result = (Success,Failure);
  41.   Positions = (Left,Right,Center);
  42.   Str80 = String[80];
  43.  
  44.   WindowPtr = ^WindowObject;
  45.   (* Pointer to window object *)
  46.   WindowObject = OBJECT
  47.   WSRow,WERow,WSCol,WECol : BYTE;
  48.   (* Starting and ending rows and columns of window *)
  49.  
  50.   WinBuf : POINTER;
  51.   (* Pointer to screen save buffer *)
  52.  
  53.   WFAttr,WBAttr : BYTE;
  54.   (* Foreground and background attributes *)
  55.  
  56.   WinFill : CHAR;
  57.   (* Window fill character *)
  58.  
  59.   WinFrame : Borders;
  60.   (* Window frame *)
  61.  
  62.   WinTitle : Str80;
  63.   (* Window title *)
  64.  
  65.   WinTitlePos : Positions;
  66.   (* Window title position *)
  67.  
  68.   ShadowOn : BOOLEAN;
  69.   (* Turns shadows on/off *)
  70.  
  71.   Active : BOOLEAN;
  72.   (* Stores active/inactive status of window *)
  73.  
  74.  PROCEDURE SaveWin;
  75.  (* Save a screen region to a buffer *)
  76.  
  77.  PROCEDURE RestWin;
  78.  (* Restore a screen region from a buffer *)
  79.  
  80.  PROCEDURE MakeWin(SRow,SCol,ERow,ECol,FAttr,BAttr : BYTE;
  81.    Frame : Borders;FillChar : CHAR;Shadow : BOOLEAN);
  82.    (* Create a window *)
  83.  
  84.  PROCEDURE RemoveWin;
  85.  (* Remove a window *)
  86.  
  87.  PROCEDURE FillWin(FillChar : CHAR);
  88.  (* Fill a window with a specified character *)
  89.  
  90.  PROCEDURE ChFrameAttr(NewAttr : BYTE);
  91.  (* Change window frame attribute *)
  92.  
  93.  PROCEDURE ChFrame(NewFrame : Borders);
  94.  (* Change frame style *)
  95.  
  96.  PROCEDURE WriteWin(WRow,WCol : BYTE;WriteStr : String);
  97.  (* Write a string in a window *)
  98.  
  99.  PROCEDURE WriteWinC(WRow : BYTE;WriteStr : String);
  100.  (* Write a string in a window, centered *)
  101.  
  102.  PROCEDURE TitleWin(Where : Positions;Title : Str80);
  103.  (* Title a window *)
  104.  
  105.  PROCEDURE ScrollWin(NumLines : BYTE;WhichWay : Direction);
  106.  (* Scroll window contents NumLines lines up or down *)
  107.  
  108.  PROCEDURE ClearWin;
  109.  (* Clear window *)
  110.  
  111.  PROCEDURE MoveWin(NewSRow,NewSCol : BYTE);
  112.  (* Move window to new row and column *)
  113.  
  114.  CONSTRUCTOR Init;
  115.  (* Initialize an object instance *)
  116.  
  117.  DESTRUCTOR Done;
  118.  (* Destroy an object instance *)
  119.  
  120.  END;
  121.  
  122. VAR
  123.  ShadowColor : BYTE;
  124.  LastWindow : BYTE;
  125.  WOk : Result;
  126.  
  127. PROCEDURE WFill(Row,Col,Rows,Cols,Attr : Byte;Ch : Char);
  128. (* Fill a screen region with a specified color and attribute *)
  129.